package com.dt.app.controller.base;

import com.dt.app.common.service.AuthenticationInfoService;
import com.dt.app.modules.sys.entities.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpSession;

public class BaseController {
    @Autowired
    private AuthenticationInfoService authenticationInfoService;
    public Integer getSysCompanyId(){
        SysUserEntity sysUserEntity = (SysUserEntity) authenticationInfoService.getAuthentication();
        return sysUserEntity.getSysCompanyId();
    }
    public String getRoleName(){
        SysUserEntity sysUserEntity = (SysUserEntity) authenticationInfoService.getAuthentication();
        return sysUserEntity.getRoleName();
    }
    public boolean isAdmin(){
        return authenticationInfoService.getIsAdmin();
    }
}
